package com.yst.metho.web.application.projectversion.views;

import nextapp.echo2.app.Column;
import nextapp.echo2.app.Extent;
import nextapp.echo2.app.Grid;
import nextapp.echo2.app.Insets;
import nextapp.echo2.app.Label;
import nextapp.echo2.app.TextField;

import com.yst.suivi.data.folders.Folder;
import com.yst.suivi.data.project.Project;

/**
 * Vue qui affiche le detail d'un folder(classification) d'un projet.
 * 
 * @author perso
 * 
 */
public class ProjectFolderPane extends Column
{
	private TextField mFolder;

	private String mId = null;

	private Project mProject;

	public ProjectFolderPane(Project prj, Folder folder)
	{
		super();
		mProject = prj;

		setCellSpacing(new Extent(10));
		setInsets(new Insets(10));
		Grid headerGrid = new Grid();
		headerGrid.setInsets(new Insets(0, 2));
		add(headerGrid);
		Label label;
		label = new Label("Nom");
		headerGrid.add(label);
		mFolder = new TextField();
		mFolder.setStyleName("TextField");
		headerGrid.add(mFolder);

		if (null != folder)
		{
			mId = folder.getId();
			mFolder.setText(folder.getNom());
		}
	}

	public ProjectFolderPane(Project prj)
	{
		this(prj, null);
	}

	/**
	 * @return the id
	 */
	public String getId()
	{
		return mId;
	}

	/**
	 * @return the login
	 */
	public String getFolder()
	{
		return mFolder.getText();
	}

	/**
	 * @return the project
	 */
	public Project getProject()
	{
		return mProject;
	}

}
